﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XStudio.XCRF.Data.Entities;
using System.Linq.Expressions;
using XStudio.XCRF.Data.Enums;

namespace XStudio.XCRF.Data.Business
{
    public static class HospitalBusiness
    {
        /// <summary>
        /// 查找医院
        /// </summary>
        /// <param name="code">医院代码</param>
        /// <returns></returns>
        public static Hospital Find(this IQueryable<Hospital> Hospitals, string code)
        {
            return Hospitals.Find(h => h.Code == code).First();
        }
        /// <summary>
        /// 判断医院是否存在
        /// </summary>
        /// <param name="code">医院代码</param>
        /// <returns></returns>
        public static bool Exist(this IQueryable<Hospital> Hospitals, string code)
        {
            return Hospitals.Exist(h => h.Code == code);
        }
    }
}
